for (var t = getApp(), a = new Date(), e = [], n = [], o = [], i = [ "上午", "中午", "下午", "晚上", "全天" ], s = a.getFullYear(); s <= 2048; s++) e.push(s);

for (var r = 1; r <= 12; r++) n.push(r);

for (var h = 1; h <= 31; h++) o.push(h);

Page({
    data: {
        winHeight: "",
        currentTab: 0,
        scrollLeft: 0,
        loadMore: !1,
        showDateSelect: !0,
        province: "全国",
        city: "全国",
        years: e,
        year: a.getFullYear(),
        months: n,
        month: 2,
        days: o,
        day: 2,
        date: "",
        dateShow: "",
        timepoints: i,
        timepoint: 2,
        value: [ 0, 1, 1, 1 ],
        reset: !1
    },
    numnberOfDayInMoth: function(t, a) {
        return 2 == a ? t % 4 == 0 && t % 100 != 0 || t % 400 == 0 ? 29 : 28 : 1 == a || 3 == a || 5 == a || 7 == a || 8 == a || 10 == a || 12 == module ? 31 : 30;
    },
    bindChange: function(t) {
        var a = t.detail.value, e = this.data.years[a[0]], n = this.data.months[a[1]], i = this.data.days[a[2]], s = a[3] + 1, r = 0;
        r = this.numnberOfDayInMoth(e, n);
        for (var h = 1; h <= r; h++) o.push(h);
        this.setData({
            year: e,
            month: n,
            day: i,
            days: o,
            timepoint: s,
            value: a
        });
    },
    bindDateConfirmTap: function(t) {
        var a;
        a = this.data.month < 10 ? "0" + this.data.month : "" + this.data.month;
        var e;
        e = this.data.day < 10 ? "0" + this.data.day : "" + this.data.day;
        var n = "" + this.data.year + a + e, o = a + "月" + e + "日";
        this.data.timepoint;
        this.setData({
            showDateSelect: !1,
            date: n,
            dateShow: o
        }), this.setData({
            reset: !0
        }), this.setData({
            reset: !1
        });
    },
    switchTab: function(t) {
        this.setData({
            currentTab: t.detail.current
        }), this.checkCor();
    },
    switchNav: function(t) {
        var a = t.target.dataset.current;
        if (this.data.currentTab == a) return !1;
        this.setData({
            currentTab: a
        });
    },
    checkCor: function() {
        if (this.data.currentTab > 3) {
            var t = this;
            wx.getSystemInfo({
                success: function(a) {
                    var e = a.windowWidth, n = e / 750 * 164 * (t.data.currentTab + .5) - e / 2;
                    t.setData({
                        scrollLeft: n
                    });
                }
            });
        } else this.setData({
            scrollLeft: 0
        });
    },
    clickDate: function() {
        this.setData({
            showDateSelect: !0
        });
    },
    onMyEvent: function(t) {
        wx.hideNavigationBarLoading(), this.setData({
            loadMore: !1
        });
    },
    onLoad: function(e) {
        for (var n = e.city, o = e.role, i = e.province, s = a.getFullYear(), r = a.getMonth() + 1, h = a.getDate(), c = this.numnberOfDayInMoth(s, r), u = [], d = 1; d <= c; d++) u.push(d);
        this.setData({
            province: i,
            city: n,
            role: o,
            currentRoleTab: o - 2,
            roles: t.globalData.roleNames,
            year: s,
            month: r,
            day: h,
            value: [ 0, r - 1, h - 1, 1 ]
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        wx.showNavigationBarLoading();
    },
    onShareAppMessage: function() {
        return {
            title: "‘婚语’婚礼人工具",
            path: "/pages/schedule/schedule",
            success: function(t) {},
            fail: function(t) {}
        };
    }
});